export default {
	methods: {
		//获取经纬度
		getLocation() {
			return new Promise((resolve, ret) => {
				uni.getLocation({
					type: 'wgs84',
					success: function(res) {
						resolve({
							lng: res.longitude,
							lat: res.latitude
						})
					},
					complete: function(res) {
						console.log('获取用户经纬度', res);
					},
					fail() {
						ret(false)
					}
				});
			})
		},
		// 过滤传参
		filterForm: (form) => {
			Object.keys(form).forEach(ele => {
				if (form[ele] === '' || form[ele] === null) {
					delete form[ele]
				}
			});
			return form;
		},
		checkObj: (obj) => {
			let arr = Object.keys(obj)
			return !!arr.length
		}
	}
}